import { Component, OnInit } from '@angular/core';
import { _HttpClient } from '@delon/theme';
import { NzMessageService } from 'ng-zorro-antd';
import { ActivatedRoute, Router } from '@angular/router';

@Component({
  selector: 'app-dashboard',
  templateUrl: './dashboard.component.html',
})
export class DashboardComponent implements OnInit {
  searchPeople: string;
  multitudePeople = true;
  items = [];
  base_items = [
    { title: '前端开发', total: '老大' },
    { title: '产品经理', total: '小二' },
    { title: '后端开发', total: '小三' },
    { title: '运维', total: '小四' },
    { title: '项目经理', total: '小五' },
    { title: '售后服务', total: '小六' },
    { title: '售前工程师', total: '小七' },
    { title: '数据库工程师', total: '小八' },
    { title: '测试', total: '小九' },
    { title: '客户经理', total: '小十' },
  ];

  constructor(private http: _HttpClient, public msg: NzMessageService, private router: Router) {}

  submit(value: any) {
    this.msg.success(JSON.stringify(value));
  }

  ngOnInit() {
    for (let index = 0; index < 100; index++) {
      this.items.push(this.base_items[Math.floor(Math.random() * 10)]);
    }
  }
  togglePeople() {
    this.multitudePeople = false;
  }
  toDetail() {
    this.router.navigate(['/detail']);
  }
}
